package com.drm.netschool.mapper;

import com.drm.netschool.entity.DrmPayTrace;
import com.drm.netschool.entity.DrmPayTraceExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface DrmPayTraceMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_pay_trace
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    int countByExample(DrmPayTraceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_pay_trace
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    int deleteByExample(DrmPayTraceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_pay_trace
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    @Delete({
        "delete from drm_pay_trace",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_pay_trace
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    @Insert({
        "insert into drm_pay_trace (id, order_id, ",
        "pay_tp, pay_dt, ",
        "pay_price, pay_state, ",
        "pay_confirmdt, pay_del, ",
        "pay_userid, confrim_uid, ",
        "confrim_desc, comfrin_yn, ",
        "trade_no)",
        "values (#{id,jdbcType=BIGINT}, #{orderId,jdbcType=VARCHAR}, ",
        "#{payTp,jdbcType=INTEGER}, #{payDt,jdbcType=TIMESTAMP}, ",
        "#{payPrice,jdbcType=BIGINT}, #{payState,jdbcType=INTEGER}, ",
        "#{payConfirmdt,jdbcType=TIMESTAMP}, #{payDel,jdbcType=INTEGER}, ",
        "#{payUserid,jdbcType=BIGINT}, #{confrimUid,jdbcType=BIGINT}, ",
        "#{confrimDesc,jdbcType=VARCHAR}, #{comfrinYn,jdbcType=INTEGER}, ",
        "#{tradeNo,jdbcType=VARCHAR})"
    })
    int insert(DrmPayTrace record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_pay_trace
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    int insertSelective(DrmPayTrace record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_pay_trace
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    List<DrmPayTrace> selectByExample(DrmPayTraceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_pay_trace
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    @Select({
        "select",
        "id, order_id, pay_tp, pay_dt, pay_price, pay_state, pay_confirmdt, pay_del, ",
        "pay_userid, confrim_uid, confrim_desc, comfrin_yn, trade_no",
        "from drm_pay_trace",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @ResultMap("BaseResultMap")
    DrmPayTrace selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_pay_trace
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    int updateByExampleSelective(@Param("record") DrmPayTrace record, @Param("example") DrmPayTraceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_pay_trace
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    int updateByExample(@Param("record") DrmPayTrace record, @Param("example") DrmPayTraceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_pay_trace
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    int updateByPrimaryKeySelective(DrmPayTrace record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_pay_trace
     *
     * @mbggenerated Thu Jul 23 23:06:59 CST 2015
     */
    @Update({
        "update drm_pay_trace",
        "set order_id = #{orderId,jdbcType=VARCHAR},",
          "pay_tp = #{payTp,jdbcType=INTEGER},",
          "pay_dt = #{payDt,jdbcType=TIMESTAMP},",
          "pay_price = #{payPrice,jdbcType=BIGINT},",
          "pay_state = #{payState,jdbcType=INTEGER},",
          "pay_confirmdt = #{payConfirmdt,jdbcType=TIMESTAMP},",
          "pay_del = #{payDel,jdbcType=INTEGER},",
          "pay_userid = #{payUserid,jdbcType=BIGINT},",
          "confrim_uid = #{confrimUid,jdbcType=BIGINT},",
          "confrim_desc = #{confrimDesc,jdbcType=VARCHAR},",
          "comfrin_yn = #{comfrinYn,jdbcType=INTEGER},",
          "trade_no = #{tradeNo,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(DrmPayTrace record);
}